0<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2019/1/22
  Time: 12:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>新增收藏</title>
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css">
    <link rel="shortcut icon" href="#" />
    <script language="javascript" type="text/javascript" src="/My97DatePicker/WdatePicker.js"></script>
</head>
<body>
<script src="/layuiadmin/layui/layui.js" charset="utf-8"></script>
<style type="text/css">
    .layui-form-item{
        margin-left: 20px;
        margin-top: 20px;
        width:500px;
    }
</style>

<form id="myform" class="layui-form" action="/InseCom"  method="get">
    <table class="layui-table">
<%--

        <tr>
            <td>收藏id</td>
            <td>
                <input type="text" id="ctId" name="ctId" autocomplete="off" placeholder="请输入收藏id" class="layui-input">
            </td>
        </tr>
--%>


        <tr>
            <td>会员id</td>
            <td>
                <input type="text" id="uId" name="uId" autocomplete="off" placeholder="请输入会员id" class="layui-input">
            </td>
        </tr>

        <tr>
            <td>商品id</td>
            <td>
                <input type="text" id="wareId" name="wareId" autocomplete="off" placeholder="请输入商品id" class="layui-input">
            </td>
        </tr>

        <tr>
            <td>会员昵称</td>
            <td>
                <input type="text" id="uNickName" name="uNickName" autocomplete="off" placeholder="请输入会员昵称" class="layui-input">
            </td>
        </tr>

        <tr>
            <td>操作</td>
            <td>
                <button class="layui-btn" onclick="sub()">立即提交</button>
                <button class="layui-btn" type="reset">重置</button>
            </td>
        </tr>
    </table>

</form>


<script src="/layuiadmin/layui/layui.js"></script>
<script>
    function s(id) {
        var str=document.getElementById("wareId").value;
        if(""==str){
            str+=id;
        }else{
            str+=","+id;
        }
        document.getElementById("wareId").value=str;
    }

    function sub() {
        var ctId = document.getElementById("ctId").value;
        var UId = document.getElementById("uId").value;
        var wareId = document.getElementById("wareId").value;
        var nickName = document.getElementById("nickName").value;
      //  var numreg = /^[0-9]*$/;
       /* if ("" == ctId) {
            alert("收藏id未填写");
            return false;
        }*/
        if ("" == UId) {
            alert("会员id未填写");
            return false;

            if ("" == wareId) {
                alert("商品未填写");
                return false;
            }
            if ("" == nickName) {
                alert("会员昵称未填写");
                return false;
            }
            var index = parent.layer.getFrameIndex(window.name);
            // 关闭窗口
            parent.layer.close(index);
            document.getElementById("myform").submit();
        }
    }
</script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function() {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;
    });
</script>
</body>
</html>
